package simulator;
/**
 * Physical object represents an entity in the environment with 
 * which the simulator/bot can interact
 */
public abstract class PhysicalObject {


  // center of object
  protected double x;
  protected double y;

  // the height of the object
  protected double tallness;

  //Determines if a point is within the bounds of this object, 
  //and hence collisions

  /**
   * Provides a way of checking the bounds of the object
   *
   * @param x x location to test
   * @param y y location to test
   * @return true if (x,y) is within bounds of objects, false otherwise
   */
  public abstract boolean intersects(double x, double y);

  /**
   * Paint method
   * 
   * @param g Graphics object to paint with
   * @see Simulator
   */
  public abstract void paint(java.awt.Graphics g);

  /**
   * Sets the x position of the center of the object
   *
   * @param newX x position of center of object
   */
  public void setX(double newX) { x = newX; }

  /**
   * Gets the x position of the center of the object
   *
   * @return x coordinate of position of center of object
   */
  public double getX() { return x; }

  /**
   * Sets the y position of the center of the object
   *
   * @param newY y position of the center of the object
   */
  public void setY(double newY) { y = newY; }

  /**
   * Gets the y position of the center of the object
   *
   * @return y coordinate of position of center of object
   */
  public double getY() { return y; }
  
}